<?php
require_once('pworks/mvc/IFilter.iface.php');
require_once('pworks/mvc/IAction.iface.php');
require_once('pworks/common/cache/impl/ApcCache.class.php');
require_once('pworks/common/httputil/DefaultHttpInputValidation.class.php');
require_once('pworks/common/httputil/HttpConst.class.php');
require_once('pworks/common/exception/SystemException.class.php');
require_once('pworks/util/MemcacheHelper.class.php');

class WSServiceTokenFilter implements IFilter {
	public function before(IAction &$action) {
        $__token__ = DefaultHttpInputValidation::getDate(HttpConst::TYPE_REQUEST, "__token__");
        if (WS_TOKEN != $__token__) {
            header("HTTP/1.0 404 Not Found");
            exit;
        }
        return null;
	}

	public function after(IAction &$action) {

		if (TRUE == $action->ut)
		{
			return 'succ';
		}
		return null;
	}
}
